#ifndef _FONT_H_
#define _FONT_H_

class Font
{
	private:
	TTF_Font* font;
	SDL_Color color;
	SDL_Surface* message;
	public:
	Font(std::string,int,SDL_Color);
	TTF_Font* getFont();
	void setFont(std::string,int);
	SDL_Color getColor();
	void setColor(SDL_Color);
	void write(std::string,int,int);
};

Font::Font(std::string _file, int size, SDL_Color _color)
{
	font=TTF_OpenFont(_file.c_str(),size);
	color=_color;
}

TTF_Font* Font::getFont()
{
	return font;
}

void Font::setFont(std::string _file, int size)
{
	TTF_CloseFont(font);
	TTF_OpenFont(_file.c_str(),size);
}

void Font::setColor(SDL_Color _color)
{
	color=_color;
}

SDL_Color Font::getColor()
{
	return color;
}

void Font::write(std::string str,int _x,int _y)
{
	message=TTF_RenderText_Solid(getFont(),str.c_str(),getColor());
	blit(_x,_y,message,SDL_GetVideoSurface());
}

#endif
